<template>
    <div>
        <p>num:{{num}}</p>
        <button @click="antiShaking">防抖</button>
        <button @click="throttling">节流</button>
    </div>
</template>

<script>
import {_debounce,_throttle} from "../untils/index"
  export default {
    name:'Time',
    data(){
        return{
            num:1,
            
        }
    },
    methods: {
      antiShaking: _debounce(function(){
            this.num++
        },2000),

        
        throttling:_throttle(function(){
            this.num++
        },2000)
    }
  }
</script>

<style scoped>
  
</style>